<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="StyleSheet" href="../css/jpetstore.css" type="text/css" media="screen"/>
</head>
<body>

<header th:replace="common/top1"></header>
<div id="BackLink">
    <a href="/catalog/viewmain">Return to Main Menu</a>
</div>
<div id="Content">
    <div id="Catalog">

        <div align="middle">
            <h1>My Orders</h1>

            <p align="center" th:if="${orderList==null}"><font size="8" color="red">您暂时还没有订单信息哦，赶快去商城购物吧！！</font></p>
            <table th:if="${orderList!=null}">
                <tr>
                    <th>Order ID</th>
                    <th>Date</th>
                    <th>Total Price</th>
                </tr>
<!--                <c:forEach var="order" items="${sessionScope.orderList}">-->
                    <tr th:each="order:${orderList}">
                        <td>
<!--                            <a href="checkOrder?orderId=${order.orderId}">${order.orderId}</a>-->
                            <a th:href="@{'/order/checkOrder?orderId='+ ${order.orderId}}" th:text="${order.orderId}" ></a>
                        </td>
                        <td th:text="${#dates.format(order.orderDate,'yyyy/MM/dd')}">
<!--                            <fmt:formatDate value="${order.orderDate}" pattern="yyyy/MM/dd hh:mm:ss"/>-->
                        </td>
                        <td th:text="'$'+ ${#numbers.formatDecimal(order.totalPrice,3,3,'COMMA')}">
<!--                            <fmt:formatNumber value="${order.totalPrice}" pattern="$#,##0.00"/>-->
                        </td>
                    </tr>
<!--                </c:forEach>-->
            </table>
        </div>
    </div>
</div>
<!--<footer th:replace="common/bottom"></footer>-->
</body>
</html>